class Token {
  constructor() {
    // 先从localstorage中获取token
    this.token = uni.getStorageSync('token') || null;
  }
  setToken(token) {
    uni.setStorageSync('token', token);
    console.log('token', token);
    return this.token = token;
  }
  getToken() {
    return this.token;
  }
  clearToken() {
    uni.removeStorageSync('token');
    return this.token = null;
  }
}
export default new Token();
